<?php


namespace sffi\phlegethon\util;


class ConfigUtil
{
    public static function getConfigFile($fileName, $path = '')
    {
        $config = require __DIR__.'\..\..\config\phlegethon.php';
        if ($config['config_path']) {
            $path =  __DIR__.'\..\..\config\\';
        }
        $path || $path = __DIR__.'/../../../../../extend';
        if (!file_exists($path . '/'. $fileName)) {
            throw new \Exception('缺少系统配置，请在'.$path.'路径中添加redis.php文件', 8000011);
        }
        return require $path . '/'. $fileName;
    }
}